package com.qianfeng.wuyang.himalaya.activity;

import android.app.Application;

import com.qianfeng.wuyang.himalaya.callback.RecommendFocusImgService;
import com.qianfeng.wuyang.himalaya.callback.RecommendFocusService;
import com.qianfeng.wuyang.himalaya.callback.anchorcallback.AanchorHttpUrl;
import com.qianfeng.wuyang.himalaya.callback.broadcastcallback.BroadcastService;
import com.qianfeng.wuyang.himalaya.callback.classifycallback.Classify_Service;
import com.qianfeng.wuyang.himalaya.callback.classifycallback.Classify_footpager_Service;
import com.qianfeng.wuyang.himalaya.callback.monthlycallback.MonthlyHttp;
import com.qianfeng.wuyang.himalaya.callback.recommendcallback.HttpGuess2_DetailService;
import com.qianfeng.wuyang.himalaya.callback.recommendcallback.RecommendService;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by ShenHao on 2016/12/5.
 */

public class MyApplication extends Application {

    private HttpGuess2_DetailService detailService;
    private RecommendService recommendService;
    private MonthlyHttp monthlyHttp;
    private Classify_Service service;
    private Classify_footpager_Service pagerService;
    private BroadcastService broadcastService;
    private AanchorHttpUrl httpUrl;
    //recommend焦点图
    private RecommendFocusImgService recommendFocusImgService;

    private AdService adService;
    private BCProvinceService bcProvinceService;
 // 推荐中的焦点图
    private RecommendFocusService recommendFocusService;



    @Override
    public void onCreate() {
        super.onCreate();
        service= new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(Classify_Service.class);
        pagerService = new  Retrofit.Builder()
                .baseUrl("http://adse.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(Classify_footpager_Service.class);
        //Monthly的Service
        monthlyHttp = new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(MonthlyHttp.class);

        //推荐的service
        recommendService = new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendService.class);

        //广播的service
        broadcastService = new Retrofit.Builder()
                .baseUrl("http://live.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(BroadcastService.class);
         httpUrl= new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(AanchorHttpUrl.class);
        adService=new Retrofit.Builder()
                .baseUrl("http://adse.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(AdService.class);
        //省市的service
        bcProvinceService = new Retrofit.Builder()
                .baseUrl("http://live.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(BCProvinceService.class);


        //推荐焦点图service
        recommendFocusImgService = new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendFocusImgService.class);
        // 推荐中的焦点图
        recommendFocusService=new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendFocusService.class);
        detailService=new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(HttpGuess2_DetailService.class);

    }
    public RecommendFocusService getRecommendFocusService(){
        //小编推荐详情接口
        return  recommendFocusService;
    }

    public HttpGuess2_DetailService getDetailService(){
        return detailService;
    //http://mobile.ximalaya.com/mobile/v1/album/detail?albumId=3523862
    }
    public Classify_Service getService(){

        return service;
    }
    public Classify_footpager_Service getPagerService(){

        return pagerService;
    }
    public MonthlyHttp getMonthlyHttp() {
        return monthlyHttp;
    }
    public RecommendService getRecommendService(){

        return recommendService;
    }
    public RecommendFocusImgService getRecommendFocusImgService(){

        return recommendFocusImgService;
    }

    public BroadcastService getBroadcastService() {
        return broadcastService;
    }
    public  AanchorHttpUrl getAanchorHttpUrl(){
        return httpUrl;
    }
    public AdService getAdService(){
        return adService;
    }
    public BCProvinceService getBcProvinceService() {
        return bcProvinceService;
    }
    //申请6.0以上百度地图的相关权限



}
